package org.jadapter.examples.wiki;

import org.junit.Test;
import static org.junit.Assert.assertEquals;
import org.jadapter.examples.foobar.Bar;
import org.jadapter.examples.foobar.Foo;
import org.jadapter.examples.foobar.FooBar;
import org.jadapter.examples.foobar.FooBean;
import org.jadapter.JAdapter;
import org.jadapter.Adapter;

/**
 * Created by IntelliJ IDEA.
 * User: pjesi
 * Date: Apr 2, 2009
 * Time: 11:55:38 PM
 * To change this template use File | Settings | File Templates.
 */
public class AutomaticConfiguration {

    @Test
    public void automaticConfiguration() {
        Adapter<Bar, Foo> fooBar = new JAdapter(FooBar.class);
        Foo foo = new FooBean(42);
        Bar bar = fooBar.transform(foo);
        int fortyThree = bar.bar();
        assertEquals(43, fortyThree);
    }

}
